#if !defined(__UDP_H__)
#define __UDP_H__

#include <string.h>
#include <sys/param.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"

#include "lwip/err.h"
#include "lwip/sockets.h"
#include "lwip/sys.h"
#include <lwip/netdb.h>

#define UDP_MAX_PACKET  15
#define UDP_PACKET_BUFFER_SIZE 128

#ifdef __cplusplus
extern "C" {
#endif


struct udp
{
    void (*multicast)(char* addr, uint16_t port);
    uint8_t (*parsePacket)(void);
    uint8_t (*read)(uint8_t *buff, uint8_t len);
    uint8_t (*send)(uint8_t *buff, uint8_t len);
    uint8_t (*send_to_cur)(uint8_t *buff, uint8_t len);
    uint8_t (*send_to)(char* addr, uint16_t port, uint8_t *buff, uint8_t len);
};
extern struct udp udp;

#ifdef __cplusplus
}
#endif

#endif // __UDP_H__
